package mips;

public class Reg {
    public String name;
    public String value;
    public boolean occupied;

    public Reg(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public String toString() {
        return "$" + name;
    }

    public void occupy() {
        this.occupied = true;
    }

    public void release() {
        this.occupied = false;
    }

    public boolean isFree() {
        return !occupied;
    }
}
